# coding: utf-8

from marshmallow import fields

from ..extensions import ma


class GameUserSchema(ma.Schema):
    uid = fields.Int(attribute='id')
    headurl = fields.Str(attribute='avatar_url')
    sex = fields.Int(attribute='gender')
    coin = fields.Int(attribute='pack.bid_point')

game_user_schema = GameUserSchema()


class AddFriendSchema(ma.Schema):
    uid = fields.Int(required=True,)
    dstuid = fields.Int(required=True,)

add_friend_schema = AddFriendSchema()


class ExchangeReformSchema(ma.Schema):
    uid = fields.Int(required=True,)
    pid = fields.Int(required=True,)
    rid = fields.Int(required=True, load_from='id',)
    count = fields.Int(required=True,)
    name = fields.Str(required=True,)
    sign = fields.Str(required=True,)

exchange_reform_schema = ExchangeReformSchema()


